home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / edit / thesrc20.zip / vax.c < prev    next >
C/C++ Source or Header  |  1995-01-26  |  5KB  |  148 lines

  1. /***********************************************************************/
  2. /* VAX.C -                                                             */
  3. /* This file contains pseudo SystemV functions that are missing on VAX.*/
  4. /***********************************************************************/
  5. /*
  6.  * THE - The Hessling Editor. A text editor similar to VM/CMS xedit.
  7.  * Copyright (C) 1991-1995 Mark Hessling
  8.  * 
  9.  * This program is free software; you can redistribute it and/or
  10.  * modify it under the terms of the GNU General Public License as
  11.  * published by the Free Software Foundation; either version 2 of
  12.  * the License, or any later version.
  13.  * 
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17.  * General Public License for more details.
  18.  * 
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; if not, write to:
  21.  * 
  22.  *    The Free Software Foundation, Inc.
  23.  *    675 Mass Ave,
  24.  *    Cambridge, MA 02139 USA.
  25.  * 
  26.  * 
  27.  * If you make modifications to this software that you feel increases
  28.  * it usefulness for the rest of the community, please email the
  29.  * changes, enhancements, bug fixes as well as any and all ideas to me.
  30.  * This software is going to be maintained and enhanced as deemed 
  31.  * necessary by the community.
  32.  *
  33.  * Mark Hessling                     email: M.Hessling@gu.edu.au
  34.  * 36 David Road                     Phone: +61 7 849 7731
  35.  * Holland Park                      Fax:   +61 7 875 5314
  36.  * QLD 4121
  37.  * Australia
  38.  */
  39.  
  40. /*
  41. $Id: vax.c 2.0 1995/01/26 16:32:23 MH Release MH $
  42. */
  43.  
  44. #include <stdio.h>
  45.  
  46. #include "the.h"
  47. /*-------------------------- external data ----------------------------*/
  48. extern char current_file;                   /* pointer to current file */
  49. /*---------------------- function definitions -------------------------*/
  50. /***********************************************************************/
  51. int reset_shell_mode()
  52. /***********************************************************************/
  53. {
  54. /*--------------------------- local data ------------------------------*/
  55. /*--------------------------- processing ------------------------------*/
  56.  return(0);
  57. }
  58. /***********************************************************************/
  59. int reset_prog_mode()
  60. /***********************************************************************/
  61. {
  62. /*--------------------------- local data ------------------------------*/
  63. /*--------------------------- processing ------------------------------*/
  64.  return(0);
  65. }
  66. /***********************************************************************/
  67. int doupdate()
  68. /***********************************************************************/
  69. {
  70. /*--------------------------- local data ------------------------------*/
  71.  unsigned short y,x;
  72. /*--------------------------- processing ------------------------------*/
  73.  getyx(CURRENT_WINDOW,y,x);
  74.  refresh();
  75.  wmove(CURRENT_WINDOW,y,x);
  76.  wrefresh(CURRENT_WINDOW);
  77.  return(0);
  78. }
  79. /***********************************************************************/
  80. int wnoutrefresh(win)
  81. WINDOW *win;
  82. /***********************************************************************/
  83. {
  84. /*--------------------------- local data ------------------------------*/
  85. /*--------------------------- processing ------------------------------*/
  86.  wrefresh(win);
  87.  return(0);
  88. }
  89. /***********************************************************************/
  90. int notimeout(win,bf)
  91. WINDOW *win;
  92. bool bf;
  93. /***********************************************************************/
  94. {
  95. /*--------------------------- local data ------------------------------*/
  96. /*--------------------------- processing ------------------------------*/
  97.  return(0);
  98. }
  99. /***********************************************************************/
  100. int wattrset(win,attrs)
  101. WINDOW *win;
  102. long attrs;
  103. /***********************************************************************/
  104. {
  105. /*--------------------------- local data ------------------------------*/
  106. #define A_NORMAL        000000000000L
  107. /*--------------------------- processing ------------------------------*/
  108.  if (attrs == A_NORMAL)
  109.     wstandend(win);
  110.  else
  111.     wstandout(win);
  112.  return(0);
  113. }
  114. /*#include "sys$login:vax.i" */
  115. #include iodef
  116. #include descrip
  117. /***********************************************************************/
  118. int keypress()
  119. /***********************************************************************/
  120. {
  121. /*--------------------------- local data ------------------------------*/
  122. struct { long length; CHARTYPE *address; } logical_name;
  123. struct { short status; short length; int remainder; } iosb;
  124.  
  125. static char kb[] = { "sys$input" };
  126. static int chan;
  127.  
  128. static char key = 0;
  129. int new_key;
  130. static int first = 1;
  131. int status;
  132. /*--------------------------- processing ------------------------------*/
  133.  
  134.  key = 0;
  135.  logical_name.length = strlen (kb);
  136.  logical_name.address = kb;
  137.  status = sys$assign (&logical_name, &chan, 0, 0);
  138.  if (status != 1)
  139.    return(-1);
  140.  status = SYS$QIOW(0, chan, IO$_READVBLK | IO$M_NOFILTR | IO$M_NOECHO
  141.         | IO$M_TIMED, &iosb, 0, 0, &key, 1,600, 0,0, 0, 0);
  142.  if (!key)
  143.     return (0);
  144.  new_key = (int)(unsigned)(key);
  145.  status = sys$dassgn (chan);
  146.  return (new_key);
  147. }
  148.